<template>
    <view class="detailBox">
        <view class="mart-30">
            <template v-if="thisData">
                <view class="topContent readBox">
                    <!-- <u-read-more ref="uReadMore" :showHeight="200" closeText="查看更多" :toggle="true"> -->
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">创建人</text>
                        </u-col>
                        <u-col span="6">
                            <text class="label-name">{{ thisData.createUserName }}</text>
                        </u-col>
                    </u-row>
                    <u-line class="marb-20"></u-line>
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">作废日期</text>
                        </u-col>
                        <u-col span="6">
                            <text class="label-name">{{ thisData.zuoFeiTime | ymd }}</text>
                        </u-col>
                    </u-row>
                    <u-line class="marb-20"></u-line>
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">安全运行时长</text>
                        </u-col>
                        <u-col span="6">
                            <text class="label-name">{{ $gx.DateDiff("date", usingWirerope.installDate, thisData.zuoFeiTime) }} 天</text>
                        </u-col>
                    </u-row>
                    <u-line class="marb-20"></u-line>
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">换绳原因</text>
                        </u-col>
                        <u-col span="6">
                            <text class="label-name">{{ thisData.reason }}</text>
                        </u-col>
                    </u-row>
                    <u-line class="marb-20"></u-line>
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">备注</text>
                        </u-col>
                        <u-col span="6">
                            <text class="label-name">{{ thisData.remark }}</text>
                        </u-col>
                    </u-row>
                    <u-line class="marb-20"></u-line>
                    <u-row gutter="0" class="marb-20">
                        <u-col span="4" textAlign="center">
                            <text class="label-name">操作</text>
                        </u-col>
                        <u-col span="3" textAlign="center">
                            <u-button type="warning" @click="onShowDetail()" size="small" text="详情"></u-button>
                        </u-col>
                        <u-col span="3" textAlign="center">
                            <u-button type="warning" class="marl-10" @click="showZuoFeiDialog()" size="small" text="专家评估"></u-button>
                        </u-col>
                    </u-row>

                    <!-- </u-read-more> -->
                </view>
            </template>
            <view v-else>
                <view class="topContent">
                    <u-empty mode="data" text="暂无数据"> </u-empty>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            thisID: null,
            thisData: {},
            UsingWirerope: {},
        };
    },
    onLoad: function (option) {
        let that = this;
        // #ifdef APP-NVUE
        const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
        // #endif
        // #ifndef APP-NVUE
        const eventChannel = this.getOpenerEventChannel();
        // #endif
        that.$refs.uReadMore.init();
    },
    beforeDestroy() {},
    methods: {
        onShowDetail() {
            let that = this;
            let url = "/pages/ropeManagement/detail";
            uni.navigateTo({
                url: url,
                success: function (res) {
                    res.eventChannel.emit("editData", {
                        data: that.thisData,
                        operateType: "详情",
                    });
                },
            });
        },
        init(data) {
            this.thisID = data.autoID;
            this.thisData = data.zuoFeiModel;
            this.usingWirerope = data;
        },
        //作废管理
        showZuoFeiDialog() {
            uni.navigateTo({
                url: "/pages/ropeArchives/zuoFei?id=" + this.thisID + "&isSee=true",
            });
        },
    },
};
</script>

<style></style>
